package me.jollyfly.jshop.user.client.api;

import me.jollyfly.jshop.common.bean.ResultBean;
import me.jollyfly.jshop.user.client.model.dto.LoginUserDTO;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * created at 2018/1/9
 *
 * @author 354649
 */
public interface UserApi {
    /**
     * @param username 用户名
     * @return 返回用户实体
     */
    @RequestMapping(value = "/user/load", method = RequestMethod.GET)
    ResultBean<LoginUserDTO> loadUserByUsername(@RequestParam("username") String username);

    /**
     * @param loginUserDTO 用户实体
     *
     * @return 登录凭证token
     */
    @RequestMapping(value = "/user/login", method = RequestMethod.POST)
    ResultBean<String> login(LoginUserDTO loginUserDTO);

}
